import Home from '@/views/Home'
import Search from '@/views/Search'
import NotFind from '@/views/NotFound.vue'
import Vue from 'vue'
import VueRouter from 'vue-router'
Vue.use(VueRouter) // VueRouter插件初始化

// 创建了一个路由对象
const router = new VueRouter({
   // 修改路由模式
   mode: 'hash',
  routes: [
    {path: '/', redirect: '/home'},
    {name: 'home', path: '/home', component: Home },
    {name: 'search', path: '/search/:keyword', component: Search },
    {path: '*', component: NotFind}
  ]
})

export default router